package com.lingyun.ucm.common.pojo.bean;

import java.io.Serializable;
import java.util.Date;
/**
 * 
 * @author Terrence2013
 * 2018年1月24日 上午9:46:11
 * 读取配置失败记录类
 */
public class ConfigAcquireFailLog implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = 2783845731869746148L;
    /**
     * id(主键自增)
     */
    private Long id;
    /**
     * 客户端ip
     */
    private String ip;
    /**
     * 异常消息,配置项+原因
     */
    private String fail_message;

    /**
     * 异常发生时间
     */
    private Date fail_time;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getFail_message() {
        return fail_message;
    }

    public void setFail_message(String fail_message) {
        this.fail_message = fail_message;
    }

    public Date getFail_time() {
        return fail_time;
    }

    public void setFail_time(Date fail_time) {
        this.fail_time = fail_time;
    }

    /**
     * 拼接配置错误消息,格式:[configKey]:cause
     * @param configKey
     * @param cause
     * @return
     */
    public String appendMessage(String configKey, String cause) {
        StringBuilder msg = new StringBuilder();
        msg.append("[").append(configKey).append("] : ").append(cause);
        return msg.toString();
    }

}
